// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import "fmt"

func reverse(slice []int) {
	for x, y := 0, len(slice)-1; x < y; x, y = x+1, y-1 {
		slice[x], slice[y] = slice[y], slice[x]
	}
}

func main() {
	slice := []int{1, 6, 168}
	reverse(slice)
	fmt.Println(slice)
}

//$ go run interview1-18.go
//[168 6 1]
